let app = new Vue({
	el:"#app",
	data:{
		msg:"hello",
		books: [
		    {
		        id: 1,
		        name: '《算法导论》',
		        date: '2006-9',
		        price: 85.0,
		        count: 1
		 
		    },
			{
		        id: 2,
		        name: '《UNIX编程艺术》',
		        date: '2006-2',
		        price: 59.0,
		        count: 1
		 
		    },
		    {
		        id: 3,
		        name: '《编程珠玑》',
		        date: '2008-10',
		        price: 39.0,
		        count: 1
		 
		    },
		    {
		        id: 4,
		        name: '《代码大全》',
		        date: '2006-3',
		        price: 128.0,
		        count: 1
		 
		        }
		    ]
	},
	methods:{
		increase(index){
			this.books[index].count++
		},
		decrease(index){
			this.books[index].count--
		},
		remove(){
			//this.books.pop()
			this.books.splice(index,1)
		}
	},
	computed:{
		totalPrice(){
			let totalPrice = 0
			for (const item of this.books) {
				totalPrice += item.price * item.count
			}
			return totalPrice
		}
	},
	filters:{
		improvePrice:function (value){
			return "￥" + value.toFixed(2)
		}
	},
	const nums = [10,20,111,222,444,40,50]
	
	let newNums = nums.fi
})